Help > Reference > Macros > Collections > Metadata collection

Metadata collection

This collection contains name-value pairs that comprise the metadata of a document. Use Metadata property of the Document object to access this collection.

You can get the value of a metadata field using the field name as a parameter of the Item property of the collection. For example the code below displays the value of the "Author" metadata field of the first document in the active tab.

MsgBox App.ActiveTab.Item(0).Metadata.Item("Author")

The collection also exposes a property Key that you can use to enumerate the names of the metadata fields, contained in the collection.

Key: Read-Only String(Index) Property

The example below displays all the metadata for the first document in the active tab.

Output = "Metadata:"
Set Meta = App.ActiveTab.Item(0).Metadata
For I = 0 To Meta.Count-1
  Output = Output & vbCrLf & Meta.Key(I) & " - " & Meta(I)
Next
MsgBox Output

See Also

Macro Object Model

Collections

Document.Metadata